home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / Hydra11s.lha / HBBS / Source / Doors_System / XPR / XPRD_Source / xproto.h < prev    next >
C/C++ Source or Header  |  1996-06-25  |  4KB  |  125 lines

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XPR_IO {
  10.           char    *xpr_filename;        /* File name(s)             */
  11.           long (*xpr_fopen)();      /* Open file                */
  12.           long (*xpr_fclose)();     /* Close file               */
  13.           long (*xpr_fread)();      /* Get char from file       */
  14.           long (*xpr_fwrite)();     /* Put string to file       */
  15.           long (*xpr_sread)();      /* Get char from serial     */
  16.           long (*xpr_swrite)();     /* Put string to serial     */
  17.           long (*xpr_sflush)();     /* Flush serial input buffer*/
  18.           long (*xpr_update)();     /* Print stuff              */
  19.           long (*xpr_chkabort)();   /* Check for abort          */
  20.           long (*xpr_chkmisc)();    /* Check misc. stuff        */
  21.           long (*xpr_gets)();       /* Get string interactively */
  22.           long (*xpr_setserial)();  /* Set and Get serial info  */
  23.           long (*xpr_ffirst)();     /* Find first file name     */
  24.           long (*xpr_fnext)();      /* Find next file name      */
  25.           long (*xpr_finfo)();      /* Return file info         */
  26.           long (*xpr_fseek)();      /* Seek in a file           */
  27.           long     xpr_extension;     /* Number of extensions    */
  28.           long    *xpr_data;        /* Initialized by Setup.    */
  29.           long (*xpr_options)();    /* Multiple XPR options.    */
  30.           long (*xpr_unlink)();     /* Delete a file.           */
  31.           long (*xpr_squery)();     /* Query serial device      */
  32.           long (*xpr_getptr)();     /* Get various host ptrs    */
  33.           };
  34. /*
  35. *   Number of defined extensions
  36. */
  37. #define XPR_EXTENSION 4L
  38.  
  39. /*
  40. *   The functions
  41. */
  42. extern long XProtocolSend(),  XProtocolReceive(),
  43.         XProtocolSetup(), XProtocolCleanup();
  44. /*
  45. *   Flags returned by XProtocolSetup()
  46. */
  47. #define XPRS_FAILURE    0x00000000L
  48. #define XPRS_SUCCESS    0x00000001L
  49. #define XPRS_NORECREQ    0x00000002L
  50. #define XPRS_NOSNDREQ    0x00000004L
  51. #define XPRS_HOSTMON    0x00000008L
  52. #define XPRS_USERMON    0x00000010L
  53. #define XPRS_HOSTNOWAIT 0x00000020L
  54. /*
  55. *   The update structure
  56. */
  57. struct XPR_UPDATE {    long  xpru_updatemask;
  58.             char *xpru_protocol;
  59.             char *xpru_filename;
  60.             long  xpru_filesize;
  61.             char *xpru_msg;
  62.             char *xpru_errormsg;
  63.             long  xpru_blocks;
  64.             long  xpru_blocksize;
  65.             long  xpru_bytes;
  66.             long  xpru_errors;
  67.             long  xpru_timeouts;
  68.             long  xpru_packettype;
  69.             long  xpru_packetdelay;
  70.             long  xpru_chardelay;
  71.             char *xpru_blockcheck;
  72.             char *xpru_expecttime;
  73.             char *xpru_elapsedtime;
  74.             long  xpru_datarate;
  75.             long  xpru_reserved1;
  76.             long  xpru_reserved2;
  77.             long  xpru_reserved3;
  78.             long  xpru_reserved4;
  79.             long  xpru_reserved5;
  80.            };
  81. /*
  82. *   The possible bit values for the xpru_updatemask are:
  83. */
  84. #define XPRU_PROTOCOL        0x00000001L
  85. #define XPRU_FILENAME        0x00000002L
  86. #define XPRU_FILESIZE        0x00000004L
  87. #define XPRU_MSG        0x00000008L
  88. #define XPRU_ERRORMSG        0x00000010L
  89. #define XPRU_BLOCKS        0x00000020L
  90. #define XPRU_BLOCKSIZE        0x00000040L
  91. #define XPRU_BYTES        0x00000080L
  92. #define XPRU_ERRORS        0x00000100L
  93. #define XPRU_TIMEOUTS        0x00000200L
  94. #define XPRU_PACKETTYPE     0x00000400L
  95. #define XPRU_PACKETDELAY    0x00000800L
  96. #define XPRU_CHARDELAY        0x00001000L
  97. #define XPRU_BLOCKCHECK     0x00002000L
  98. #define XPRU_EXPECTTIME     0x00004000L
  99. #define XPRU_ELAPSEDTIME    0x00008000L
  100. #define XPRU_DATARATE        0x00010000L
  101. /*
  102. *   The xpro_option structure
  103. */
  104. struct xpr_option {
  105.    char *xpro_description;    /* description of the option              */
  106.    long  xpro_type;        /* type of option                  */
  107.    char *xpro_value;        /* pointer to a buffer with the current value */
  108.    long  xpro_length;        /* buffer size                      */
  109. };
  110. /*
  111. *   Valid values for xpro_type are:
  112. */
  113. #define XPRO_BOOLEAN 1L     /* xpro_value is "yes", "no", "on" or "off"   */
  114. #define XPRO_LONG    2L     /* xpro_value is string representing a number */
  115. #define XPRO_STRING  3L     /* xpro_value is a string              */
  116. #define XPRO_HEADER  4L     /* xpro_value is ignored              */
  117. #define XPRO_COMMAND 5L     /* xpro_value is ignored              */
  118. #define XPRO_COMMPAR 6L     /* xpro_value contains command parameters     */
  119.  
  120. long XProtocolSend(struct XPR_IO*);
  121. long XProtocolReceive(struct XPR_IO*);
  122. long XProtocolSetup(struct XPR_IO*);
  123. long XProtocolCleanup(struct XPR_IO*);
  124.  
  125.